@import '../../themes/mixins/animations';

.component {
  background-color: var(--theme-notification-message-background-color);
  box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.25);
  height: 0;
  left: 0;
  overflow: hidden;
  position: absolute;
  right: 0;
  text-align: center;
  top: 0;
  transition: all 200ms linear;
  width: 100%;

  &.isVisible {
    height: 62px;
    padding: 9px 0;
  }

  &.themeOverrideGrey {
    background-color: rgba(94, 96, 102, 0.95);

    .closeButton svg polygon,
    .icon svg g path:nth-child(2) {
      fill: var(--rp-tooltip-text-color);
    }

    .message {
      color: var(--rp-tooltip-text-color);
    }
  }

  &.clickToClose {
    cursor: pointer;

    &:hover {
      .closeButton {
        opacity: 0.8;
      }
    }
  }

  .icon {
    display: inline-block;
    margin-right: 10px;
    vertical-align: top;

    & > svg {
      height: 44px;
      width: 44px;

      g {
        path:nth-child(2) {
          fill: var(--theme-notification-message-checkmark-icon-color);
        }
      }
    }

    .spinnerIcon {
      flex-shrink: 0;
      height: 22px;
      margin-top: 10px;
      width: 22px;

      & > svg {
        height: inherit;
        width: inherit;

        path {
          fill: var(--theme-notification-message-text-color);
        }
      }
    }

    .spinnerIcon :global {
      animation: loading-spin 1.5s linear;
      animation-iteration-count: infinite;
    }
  }

  .message {
    color: var(--theme-notification-message-text-color);
    display: inline-block;
    font-family: var(--font-regular);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 45px;

    &.hasEllipsis {
      @include animated-ellipsis($width: 16px);
    }
  }

  .closeButton {
    cursor: pointer;
    height: 62px;
    opacity: 0.5;
    position: absolute;
    right: 0;
    top: 0;
    width: 62px;

    &:hover {
      opacity: 0.8;
    }

    > span {
      display: block;
      margin-top: -1px;
    }

    svg {
      height: 11px;
      width: 11px;

      polygon {
        fill: var(--theme-notification-message-close-icon-color);
      }
    }
  }
}
